package IO;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;

public class IODemo {

	/**
	 * @param arBgs
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		/*byte[] byteArr = new byte[10];
		DataInputStream dataInputStream = new DataInputStream(new ByteArrayInputStream(byteArr));
		dataInputStream.readInt();
		
		new DataInputStream(new FileInputStream("d://t.txt")).readInt();
		*/
		/*BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File("d:\\tt.txt")));
		
		bufferedOutputStream.write(12);
		
		bufferedOutputStream.write("str".getBytes());
		bufferedOutputStream.close();
		*/
		/*ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream("d://wlj.txt"));
		
		JDB jdb = new JDB();
		
		objectOutputStream.writeObject(jdb);
		
		objectOutputStream.close();*/
		
		try {
			read();
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
}
	
	public static void read() throws FileNotFoundException, IOException, ClassNotFoundException {
		ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream("d://wlj.txt"));
		Object obj = inputStream.readObject();
		System.out.println(obj.getClass());
	}
}

class WLJ implements Serializable{
	
}

class JDB extends WLJ{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 8791477466474962107l;

	public JDB() {
		System.out.println("construct JDB....");
	}
	
	
	
}


